<%@page import="cn.news.dao.*,cn.news.entity.*,util.*"%>

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
	String uname = request.getParameter("uname");
	String password = request.getParameter("upwd");
    UserDao userDao=new UserDao();    
    User user =userDao.findUser(uname,password);
	if(user==null){	
%>
<script>
	alert("用户名密码错误，请重新登录");
	open("index.jsp","_self");	
</script>
<%
	}else{	
		
		session.setAttribute("login",uname);
		session.setMaxInactiveInterval(10*60);
		request.getRequestDispatcher("admin.jsp").forward(request,response);
	}
%>
